package com.project.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @author lyl
 * description:上下文监听器
 */
public class ContextListener implements ServletContextListener {

    /**
     * 创建上下文对象时触发
     *
     * @param sce
     */
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("web上下文创建");
    }

    /**
     * 销毁上下文对象时候触发
     *
     * @param sce
     */
    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("web上下文销毁");
    }
}
